import { useState } from 'react'
import './App.css'
import { ColorBrowser } from './components/colorBrowser'
import { ColorPicker } from './components/colorPicker'
import { Color } from './model/color'

function App() {
  // use命名开始的一个钩子函数 <> 用泛型来解决
  const [color, setColor] = useState<Color>({
    red: 20,
    green: 40,
    blue: 180
  })
  return (
    <>
      <ColorPicker onColorUpdated={setColor} color={color} />
      <ColorBrowser color={color} />
    </>
  )
}

export default App